package com.example.administrator.orchardeveryday.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.administrator.orchardeveryday.R;
import com.example.administrator.orchardeveryday.bean.FruitTop;
import com.example.administrator.orchardeveryday.utils.ImageLoaderHelper;
import com.nostra13.universalimageloader.core.DisplayImageOptions;

import java.util.List;

/**
 * Created by Administrator on 15-10-24.
 */
public class FruitFriendsHeadAdapter extends AppBaseAdapter<FruitTop>{
    DisplayImageOptions displayImage;
    public FruitFriendsHeadAdapter(List<FruitTop> list, Context context) {
        super(list, context);
        displayImage = ImageLoaderHelper.getDisplayImageLoader();
    }

    @Override
    public ViewHolder getViewHolder(int position, View convertView, ViewGroup parent) {
        FruitTop fruitTop=list.get(position);
        ViewHolder vh=ViewHolder.get(context,convertView,parent, R.layout.item_fruit_friends_head);
        TextView top= (TextView) vh.findViewById(R.id.item_fruit_friends_head_top);
        TextView select= (TextView) vh.findViewById(R.id.item_fruit_friends_head_select);
        TextView activity= (TextView) vh.findViewById(R.id.item_fruit_friends_head_activity);
        TextView title= (TextView) vh.findViewById(R.id.item_fruit_friends_head_title);
        if(fruitTop.getPtype().equals("0"))
        {
            activity.setVisibility(View.GONE);
        }
        title.setText(fruitTop.getData().getTitle());
        return vh;
    }
}
